#pragma once

#include "exception.h"
#include "../Forward.h"

namespace Xml
{
  class ContentException : public Exception
  {
  public:
    ContentException(const Node &node,const Glib::ustring &msg);
    ~ContentException() throw();

    virtual const char* what() const throw();
    virtual Exception * Clone() const;

  private:
    Glib::ustring           file_name;
    int                     line;
    Glib::ustring           message;

    mutable bool            full_message_dirty;
    mutable Glib::ustring   full_message;

    void format_message() const;
  };

  class AttributeException : public ContentException
  {
  public:
    AttributeException(const Element &element,
      const Glib::ustring &attrib_name,const Glib::ustring &msg);

  private:
    static const Attribute& get_attribute(const Xml::Element &element,
      const Glib::ustring &attrib_name);
  };
}
